Skip to main content
Version: 5.5

Core

ApplicationKeys

Within the class TimePunch.Enums.Core.ApplicationKeys the application keys are defined. This can be used to verify the application licenses. Following methods are important for that:

  • ValidateAuthentication
  • GetLicensedUserProfiles

The following constant values are defined:

public static class ApplicationKeys

{

/// <summary>

/// Application Key for TimePunch PRO

/// </summary>

public const string TIMEPUNCH_PRO = "Tp";

/// <summary>

/// Application Key for TimePunch ONE

/// </summary>

public const string TIMEPUNCH_ONE = "One";

/// <summary>

/// Application Key for TimePunch TEN

/// </summary>

public const string TIMEPUNCH_TEN = "Ten";

/// <summary>

/// Application Key for PZE Terminal

/// </summary>

public const string PZE_TERMINAL = "PZE";

/// <summary>

/// Application Key for PZE Watcher

/// </summary>

public const string PZE_WATCHER = "WAT";

/// <summary>

/// Application Key for PZE Studio

/// </summary>

public const string PZE_STUDIO = "STU";

/// <summary>

/// Application Key for PZE Studio

/// </summary>

public const string PZE_ONLINE = "ONL";

}

Hash the password with the MD5 cryptography provider

The following code makes use of the MD5 cryptography provider in order to hash a password. The hashed password can be used to do the authorization with the TpAuthentication entity.

public static string MD5Hash(string text)

{

System.Security.Cryptography.MD5 md5

= new System.Security.Cryptography.MD5CryptoServiceProvider();

return System.Text.RegularExpressions.Regex

.Replace(BitConverter.ToString(

md5.ComputeHash(ASCIIEncoding.Default.GetBytes(text))), "-", "");

}